package com.example.custom.mybatis.mapper;


import com.example.custom.mybatis.entity.Userinfo;
import com.example.sources.Insert;
import com.example.sources.Param;
import com.example.sources.Select;

import java.util.List;

/**
 * @author liyuncong
 * @version 1.0
 * @file userDao
 * @brief userDao
 * @details userDao
 * @date 2022-11-13
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2022-11-13               liyuncong          Created
 */
public interface UserDao {

    @Select("select * from userinfo where username = #{username}")
    List<Userinfo> findAllByUsername(@Param("username") String username);

    @Insert("insert into userinfo (id, username, age, gender) values (#{id}, #{username}, #{age}, #{gender})")
    int insert(@Param("userinfo") Userinfo userinfo);
}
